import java.util.Scanner;


public class CalcAPI {
	
	public boolean checkIfOdd(int a) {
		int result = a%2;
		if (result == 1)
			return true;
		else
			return false;		
	}
	
	public float getFloatInput() {		
		float userInput = 0;
		int status=0;
		do 
		{
			try {
				status = 0;
				Scanner s = new Scanner(System.in);
				userInput = s.nextFloat();
			}catch (Exception e) {
				System.out.println("Please enter float type only");
				System.out.println(e);
				status=1;
			}			
		}while(status == 1);
		return(userInput);
	}
	
	public int getIntInput() {		
		int userInput = 0;
		int status=0;
		do 
		{
			try {
				status = 0;
				Scanner s = new Scanner(System.in);
				userInput = s.nextInt();
			}catch (Exception e) {
				System.out.println("Please enter float type only");
				System.out.println(e);
				status=1;
			}			
		}while(status == 1);
		return(userInput);
	}
	
	public float add(float a, float b) {
		return(a+b);		
	}
	public float multiply(float a, float b) {
		return(a*b);		
	}
	public float subtract(float a, float b) {
		return(a-b);		
	}
	public float divide(float a, float b) {
		return(a/b);		
	}
}
